﻿//------------------------------------------------------------------------------
//  
//------------------------------------------------------------------------------
#region Imported Namespaces
using System;
using PHSRAG.Insight21.Agreements.Reports;
using PHSRAG.Insight21.Purchasing.Reports;
using PHSRAG.Insight21.ClinicalTrials;
using PHSRAG.Insight21.Common.Reports;
using PHSRAG.Insight21.Personnel.Reports;

#endregion

namespace PHSRAG.Insight21.Reports {

    public class ReportFactory  
    {
        private const string ExpRpt = "expensereport";
        private const string SalRpt = "salaryreport";
        private const string revRpt = "revenuebreakdownreport";
        private const string lbrRpt = "labordistribution";
        private const string lbrRptGL = "labordistributiongl";
        private const string jeRpt = "financialtransaction";
        private const string bbkRpt = "budgetbreakdown";
        private const string cdRpt = "agmt_contractdetails";
        private const string pjRpt = "agmt_projections";
        private const string trRpt = "transactionreport";
        private const string pur_usRpt = "userordersummary";
        private const string agmt_laborMonthRpt = "labor_month";
        private const string agmt_finSummaryRpt = "financialsummary";
        private const string agmt_agmtSummaryRpt = "agreement_summary";
        private const string agmt_BudgetOverviewRpt = "budget_overview";
        private const string arra_proposal = "arra_proposaldata";
        private const string arra_subrecipient = "arra_subrecipientdata";
        private const string arra_vendor = "arra_vendordata";
        private const string advancefundrequest = "advancefundrequest";
        public const string ct_ExternalOutput = "ct_externaloutput";
        public const string ct_InternalOutput = "ct_internaloutput";
		public const string PatientCareDetails = "agmt_patientcaredetails";

        public ReportFactory()
        {
        }

        public iReport getReport(string pageUrl, string rptName, string rptFormat)
        {
            switch (rptName.ToLower()) {
                // agreements 
                case ExpRpt:
                    return new sqlExpenseReport(pageUrl);
                case SalRpt:
                    return new sqlSalaryReport(pageUrl);
                case revRpt:
                    return new sqlRevenueBreakdownReport(pageUrl);
                case lbrRpt:
                    return new sqlLaborDistributionReport(pageUrl);
                case lbrRptGL:
                    return new sqlLaborDistributionReport(pageUrl + "?protocolId=distributionGL");
                case agmt_laborMonthRpt:
                    return new sqlLaborDistributionReport(pageUrl);
                case jeRpt:
                    return new sqlFinancialTransactionReport(pageUrl);
                case bbkRpt:
                    return new sqlBudgetBreakdownReport(pageUrl);
                case cdRpt:
                    return new sqlContractDetailsReport(pageUrl);
                case pjRpt:
                    return new sqlProjectionsReport(pageUrl);
                case trRpt:
                    return new sqlTransactionReport(pageUrl);
                case agmt_finSummaryRpt:
                    return new sqlFinancialSummaryReport(pageUrl);
                case agmt_agmtSummaryRpt:
                    //if (rptFormat.ToLower() == "excel")
                    //    return new sqlFinancialSummaryReport(pageUrl);
                    //else
                        return new sqlAgreementSummaryReport(pageUrl);

	            case PatientCareDetails :
                    return new sqlPatientCareDetailsReport(pageUrl);
                case agmt_BudgetOverviewRpt:
                    return new sqlBudgetOverviewReport(pageUrl);
                // purchasing
                case pur_usRpt:
                    return new sqlUserOrderSummaryReport(pageUrl);

                // clinical Trial
                case ct_ExternalOutput:
                case ct_InternalOutput:
                    return new sqlClinicalTrialReport(pageUrl);
                case arra_proposal:
                case arra_subrecipient:
                case arra_vendor:
                    return new sqlArraReport(pageUrl);
                case advancefundrequest:
                    return new sqlAdvanceFundRequest(pageUrl);    
                default:
                    throw new Exception("no report ob found");
            }
        }

    }
}
